

<?php
require 'Controller.php ';
require './admin/Model/typeModel.php';
	class typeController extends Controller{
	function __Construct(){
		parent::__Construct();
		$this->mod = 'vv';
	}



function typeList(){

	$model = new typeModel();
		$data = $model->typeList();
		$this->assign('videotype',$data);
		$this->display(); 

}

function deltype(){


$id = $_GET['id'];
		$model = new typeModel();
		$result = $model->deltype($id);
		if($result){
			echo '删除成功 <a href="index.php?c=user&m=listusers">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='index.php?c=user&m=listusers'");
		}
		else{
			echo "删除失败！<br/>";
  			echo "<a href='index.php?c=user&m=listusers'>返回</a>";
		}
}


function typeform(){

   $this->display();

}
 function typemod(){

 		$id = $_GET['id'];
		$model = new typeModel();
		$result = $model->gettypeByID($id);
		$this->assign('videotype',$result);
		$this->display(); 
 }

 function updatetype(){

   	$data = $_POST;
		$model = new typeModel();
		$result = $model->updatetype($data);
		if($result){
			echo '更新成功 <a href="index.php?c=user&m=listusers">如果没有跳转，请点这里跳转</a>';
   			header("refresh:3;url='index.php?c=user&m=listusers'");
		}
		else{
			echo "更新失败！<br/>";
  			echo "<a href='index.php?c=user&m=usermod&id=".$data['id']."'>返回</a>";
		}

 }
	
}
?>